//
//  UserInfo.m
//  HealthScale
//
//  Created by zhangjikun on 12-11-7.
//  Copyright (c) 2012年 无比动力. All rights reserved.
//

#import "UserInfo.h"

@implementation UserInfo

@synthesize _nSex;
@synthesize _nAge;
@synthesize _nHeight;
@synthesize _nWeight;

@synthesize _szName;

#pragma NSCoding delegate
//coder是解码
- (id) initWithCoder: (NSCoder *)coder
{
    if (self = [super init])
    {
        self._nSex = [coder decodeIntForKey:@"_nSex"];
        self._nAge = [coder decodeIntForKey:@"_nAge"];
        self._nHeight = [coder decodeIntForKey:@"_nHeight"];
        self._nWeight = [coder decodeIntForKey:@"_nWeight"];
        
        self._szName = [coder decodeObjectForKey:@"_szName"];
        
    }
    return self;
}

//encoder是编码
- (void) encodeWithCoder: (NSCoder *)coder
{
    [coder encodeInt:self._nSex forKey:@"_nSex"];
    [coder encodeInt:self._nAge forKey:@"_nAge"];
    [coder encodeInt:self._nHeight forKey:@"_nHeight"];
    [coder encodeInt:self._nWeight forKey:@"_nWeight"];

    [coder encodeObject:_szName forKey:@"_szName"];

}
@end
